package cn.ming.wfchat.app.dialog;

import android.os.Bundle;
import android.view.View;

import androidx.databinding.ViewDataBinding;
import cn.ming.wfchat.R;
import cn.ming.wfchat.databinding.ExchangeUsdtListBinding;
import cn.ming.wfchat.kit.dialog.CenterDialog;

/**
 * @author luoming
 * created at 2020-05-09 22:24
 * 飞机币兑换列表
 */
public class ExchangeUsdtListDialog extends CenterDialog {
    private ExchangeUsdtListBinding binding;
    private OnClickListener onClickListener;

    /**
     * 定义结果回调接口
     */
    public interface OnClickListener {
        void topUp();

        void withdrawal();
    }

    public ExchangeUsdtListDialog setOnClickListener(OnClickListener onClickListener) {
        this.onClickListener = onClickListener;
        return this;
    }


    @Override
    public int getLayoutId() {
        return R.layout.exchange_usdt_list;
    }


    public static ExchangeUsdtListDialog newInstance() {
        ExchangeUsdtListDialog dialog = new ExchangeUsdtListDialog();
        Bundle bundle = new Bundle();
        dialog.setArguments(bundle);
        return dialog;
    }


    @Override
    public void initView(ViewDataBinding dataBinding) {
        binding = (ExchangeUsdtListBinding) dataBinding;
        binding.tvToUp.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismissAllowingStateLoss();
                onClickListener.topUp();
            }
        });
        binding.tvWithdrawal.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismissAllowingStateLoss();
                onClickListener.withdrawal();
            }
        });
        binding.tvCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismissAllowingStateLoss();
            }
        });

    }

    @Override
    public boolean isBottom() {
        return true;
    }

    @Override
    public boolean isCancele() {
        return true;
    }

}
